
/*
  TODO: Consider having a separate SceneMgr class that contains the root node and the camera etc.
          It would then use IRenderer simply for low-level rendering.
		  IRenderer could have methods like applyTransform( ), renderMesh( ) etc., wrapping up the underlying graphics library.
*/

#ifndef _SDLRENDERER_HPP
#define _SDLRENDERER_HPP

#include <SDL/SDL.h>

#include "IRenderer.hpp"
#include "String.hpp"
#include "SceneNode.hpp"

class SDLRenderer : public IRenderer
{
	IRendererHandler* m_handler;
	//SceneNode*        m_rootnode;
	size_t            m_width, m_height;
	float             m_aspect;
	
	void initOpenGL();
	
public:
	SDLRenderer(IRendererHandler* handler,
				const String title="SDL window",
				size_t width=640, size_t height=480,
				size_t bpp=0, bool fullscreen=false);
	virtual ~SDLRenderer()
	{
		SDL_Quit();
	}
	
	virtual size_t getWidth() const { return m_width; }
	virtual size_t getHeight() const { return m_height; }
	virtual float getAspect() const { return m_aspect; }
	
	virtual void update();
};

#endif //_SDLRENDERER_HPP
